<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - sessions.c File Reference</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="http://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="http://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="http://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">sessions.c File Reference</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Wed Aug 17 2016</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.10 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b4c3aec6cd8f28418150dce663061cfa.html">plugin</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">sessions.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="sessions_8h.html">sessions.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for sessions.c:</div>
<div class="dyncontent">
<div class="center"><img src="sessions_8c__incl.png" border="0" usemap="#sessions_8c" alt=""/></div>
<map name="sessions_8c" id="sessions_8c">
<area shape="rect" id="node3" href="sessions_8h.html" title="sessions.h" alt="" coords="43,83,127,111"/>
<area shape="rect" id="node7" href="threads_8h.html" title="threads.h" alt="" coords="86,161,161,189"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a27b5742e46f66cc7fb68d4c7c74b26de"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a27b5742e46f66cc7fb68d4c7c74b26de">sessions_init</a> (struct soap *soap)</td></tr>
<tr class="memdesc:a27b5742e46f66cc7fb68d4c7c74b26de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used by plugin registry function.  <a href="#a27b5742e46f66cc7fb68d4c7c74b26de">More...</a><br /></td></tr>
<tr class="separator:a27b5742e46f66cc7fb68d4c7c74b26de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5ea118213749cb0ce001879de12362d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ae5ea118213749cb0ce001879de12362d">sessions_delete</a> (struct soap *soap, struct soap_plugin *p)</td></tr>
<tr class="memdesc:ae5ea118213749cb0ce001879de12362d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes all sessions. Called when plugin is ended by first caller.  <a href="#ae5ea118213749cb0ce001879de12362d">More...</a><br /></td></tr>
<tr class="separator:ae5ea118213749cb0ce001879de12362d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12965eefeba72c54882e27e4bcaf9345"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a12965eefeba72c54882e27e4bcaf9345">sessions</a> (struct soap *soap, struct soap_plugin *p, void *arg)</td></tr>
<tr class="memdesc:a12965eefeba72c54882e27e4bcaf9345"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plugin registry function, invoked by soap_register_plugin.  <a href="#a12965eefeba72c54882e27e4bcaf9345">More...</a><br /></td></tr>
<tr class="separator:a12965eefeba72c54882e27e4bcaf9345"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada1884030904ff77824e3dbbcbec7a01"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ada1884030904ff77824e3dbbcbec7a01">soap_session_cookie_create</a> (struct soap *soap, const char *value, const char *domain, const char *path, long maxage)</td></tr>
<tr class="memdesc:ada1884030904ff77824e3dbbcbec7a01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intended for internal plugin use. Creates a cookie that will be sent to the client, named SESSION_COOKIE_NAME with the given value, domain, and path.  <a href="#ada1884030904ff77824e3dbbcbec7a01">More...</a><br /></td></tr>
<tr class="separator:ada1884030904ff77824e3dbbcbec7a01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bee91148cedca55855d7297690aafc8"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a7bee91148cedca55855d7297690aafc8">soap_session_cookie_delete</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a7bee91148cedca55855d7297690aafc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intended for internal plugin use. Creates a cookie that will be sent to the client, named SESSION_COOKIE_NAME with the given domain and path. The value will be empty and it will be set to expire when the client recieves it. This ensures the session ID is no longer in the client's cookie.  <a href="#a7bee91148cedca55855d7297690aafc8">More...</a><br /></td></tr>
<tr class="separator:a7bee91148cedca55855d7297690aafc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca8181bca0dfcca9f4a44058e1bda489"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#aca8181bca0dfcca9f4a44058e1bda489">soap_session_internal_find</a> (struct soap *soap, const char *domain, const char *path, time_t when)</td></tr>
<tr class="memdesc:aca8181bca0dfcca9f4a44058e1bda489"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intended for internal plugin use. Find the current session with domain and path. Returns NULL if not found or if the session is expired (for normal use, set <code>when</code> to <code>time(NULL)</code>). Will also clear the cookie if the session is expired.  <a href="#aca8181bca0dfcca9f4a44058e1bda489">More...</a><br /></td></tr>
<tr class="separator:aca8181bca0dfcca9f4a44058e1bda489"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a539448f198293a94eae014318369036f"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a539448f198293a94eae014318369036f">soap_get_sessions_head</a> ()</td></tr>
<tr class="memdesc:a539448f198293a94eae014318369036f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets soap_sessions (first node in sessions linked list).  <a href="#a539448f198293a94eae014318369036f">More...</a><br /></td></tr>
<tr class="separator:a539448f198293a94eae014318369036f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af89638dcb0fed58b795c3134f847d69d"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#af89638dcb0fed58b795c3134f847d69d">soap_purge_sessions</a> (struct soap *soap, const char *domain, const char *path, time_t when)</td></tr>
<tr class="memdesc:af89638dcb0fed58b795c3134f847d69d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all sessions that have been stale longer than their max_inactive_secs allows. -1 max_inactive_secs means the session will never expire. The when parameter is usually the current time, i.e. time(NULL) to purge sessions that expire after the when time.  <a href="#af89638dcb0fed58b795c3134f847d69d">More...</a><br /></td></tr>
<tr class="separator:af89638dcb0fed58b795c3134f847d69d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a522ae0821d5fe7c649592815e59f3c6a"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a522ae0821d5fe7c649592815e59f3c6a">soap_get_num_sessions</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a522ae0821d5fe7c649592815e59f3c6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of sessions in the database.  <a href="#a522ae0821d5fe7c649592815e59f3c6a">More...</a><br /></td></tr>
<tr class="separator:a522ae0821d5fe7c649592815e59f3c6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0174ffa84386ab41f9e1d2ba8794d04"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#aa0174ffa84386ab41f9e1d2ba8794d04">soap_get_session</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:aa0174ffa84386ab41f9e1d2ba8794d04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the session identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path. Updates session's last_touched to now. Returns NULL if not found.  <a href="#aa0174ffa84386ab41f9e1d2ba8794d04">More...</a><br /></td></tr>
<tr class="separator:aa0174ffa84386ab41f9e1d2ba8794d04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61db3eb7e302105558a0871e120fa108"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a61db3eb7e302105558a0871e120fa108">soap_start_session</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a61db3eb7e302105558a0871e120fa108"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new session with a random 128-bit ID. A cookie will be created with name SESSION_COOKIE_NAME and the given domain and path. If there already exists a session ID cookie, the only action will be updating the session's last_touched to now. Returns a pointer to the session.  <a href="#a61db3eb7e302105558a0871e120fa108">More...</a><br /></td></tr>
<tr class="separator:a61db3eb7e302105558a0871e120fa108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab109b671edecc2dd065b5416c2f3c45a"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ab109b671edecc2dd065b5416c2f3c45a">soap_regenerate_session_id</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:ab109b671edecc2dd065b5416c2f3c45a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The session ID for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path) will be set to a new random 128-bit ID. Also updates the cookie. Returns a pointer to the session.  <a href="#ab109b671edecc2dd065b5416c2f3c45a">More...</a><br /></td></tr>
<tr class="separator:ab109b671edecc2dd065b5416c2f3c45a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a341353355afa9a8dfbfb3a348a928c8f"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a341353355afa9a8dfbfb3a348a928c8f">soap_end_sessions</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a341353355afa9a8dfbfb3a348a928c8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees all sessions in database.  <a href="#a341353355afa9a8dfbfb3a348a928c8f">More...</a><br /></td></tr>
<tr class="separator:a341353355afa9a8dfbfb3a348a928c8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad73417b764dd9ebfcf0eba4c8dff48f5"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ad73417b764dd9ebfcf0eba4c8dff48f5">soap_end_session</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:ad73417b764dd9ebfcf0eba4c8dff48f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Also clears the cookie.  <a href="#ad73417b764dd9ebfcf0eba4c8dff48f5">More...</a><br /></td></tr>
<tr class="separator:ad73417b764dd9ebfcf0eba4c8dff48f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf0feecf4196b36cb479faf3ec5ccf87"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 long SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#aaf0feecf4196b36cb479faf3ec5ccf87">soap_get_session_cookie_maxage</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:aaf0feecf4196b36cb479faf3ec5ccf87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the cookie_maxage for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the cookie is a session cookie. 0 means a session was not found or is expired.  <a href="#aaf0feecf4196b36cb479faf3ec5ccf87">More...</a><br /></td></tr>
<tr class="separator:aaf0feecf4196b36cb479faf3ec5ccf87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7455f112585da290cf814b7b002496a6"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a7455f112585da290cf814b7b002496a6">soap_set_session_cookie_maxage</a> (struct soap *soap, long maxage, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a7455f112585da290cf814b7b002496a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the cookie_maxage for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the cookie will be a session cookie. If successful, returns SOAP_OK, or SOAP_ERR otherwise.  <a href="#a7455f112585da290cf814b7b002496a6">More...</a><br /></td></tr>
<tr class="separator:a7455f112585da290cf814b7b002496a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6d91a83816d098d4811192616bad6f0"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 long SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ac6d91a83816d098d4811192616bad6f0">soap_get_session_max_inactive_secs</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:ac6d91a83816d098d4811192616bad6f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the max_inactive_secs for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session will never expire. 0 means the session wasn't found or is expired.  <a href="#ac6d91a83816d098d4811192616bad6f0">More...</a><br /></td></tr>
<tr class="separator:ac6d91a83816d098d4811192616bad6f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa12654f17fa42f4cdd93a3a11aec435"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#aaa12654f17fa42f4cdd93a3a11aec435">soap_set_session_max_inactive_secs</a> (struct soap *soap, long max, const char *domain, const char *path)</td></tr>
<tr class="memdesc:aaa12654f17fa42f4cdd93a3a11aec435"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the max_inactive_secs for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session will never expire. If successful, returns SOAP_OK, or SOAP_ERR otherwise.  <a href="#aaa12654f17fa42f4cdd93a3a11aec435">More...</a><br /></td></tr>
<tr class="separator:aaa12654f17fa42f4cdd93a3a11aec435"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0129b80db0867c481da326066479d0c3"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a0129b80db0867c481da326066479d0c3">soap_get_session_rolling</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a0129b80db0867c481da326066479d0c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <code>rolling</code> flag for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session was not found or is expired.  <a href="#a0129b80db0867c481da326066479d0c3">More...</a><br /></td></tr>
<tr class="separator:a0129b80db0867c481da326066479d0c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4bfe8aeec045e9f31bd860fa4627ef8"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ab4bfe8aeec045e9f31bd860fa4627ef8">soap_set_session_rolling</a> (struct soap *soap, int rolling, const char *domain, const char *path)</td></tr>
<tr class="memdesc:ab4bfe8aeec045e9f31bd860fa4627ef8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the <code>rolling</code> flag for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). If successful, returns SOAP_OK, or SOAP_ERR otherwise.  <a href="#ab4bfe8aeec045e9f31bd860fa4627ef8">More...</a><br /></td></tr>
<tr class="separator:ab4bfe8aeec045e9f31bd860fa4627ef8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a086a1202b1aec2daa62f0e03dfc6d6ef"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 int SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a086a1202b1aec2daa62f0e03dfc6d6ef">soap_get_num_session_vars</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a086a1202b1aec2daa62f0e03dfc6d6ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of sessions variables in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Returns -1 if the session does not exist.  <a href="#a086a1202b1aec2daa62f0e03dfc6d6ef">More...</a><br /></td></tr>
<tr class="separator:a086a1202b1aec2daa62f0e03dfc6d6ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ef5df49d2579505149b4f7ca5c388cd"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 const char *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a9ef5df49d2579505149b4f7ca5c388cd">soap_get_session_var</a> (struct soap *soap, const char *name, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a9ef5df49d2579505149b4f7ca5c388cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns session_var value by name in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Returns NULL if not found.  <a href="#a9ef5df49d2579505149b4f7ca5c388cd">More...</a><br /></td></tr>
<tr class="separator:a9ef5df49d2579505149b4f7ca5c388cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60cae529297cd676f6781328c0f39cd5"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 struct <a class="el" href="structsoap__session__var.html">soap_session_var</a> *SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a60cae529297cd676f6781328c0f39cd5">soap_set_session_var</a> (struct soap *soap, const char *name, const char *value, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a60cae529297cd676f6781328c0f39cd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add new session_var with the given name and value to the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). If the name is already used, the value is re-written. If successful, returns pointer to a session_var node in the session's linked list, or NULL otherwise.  <a href="#a60cae529297cd676f6781328c0f39cd5">More...</a><br /></td></tr>
<tr class="separator:a60cae529297cd676f6781328c0f39cd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed123a1f21f9a60d671966d6d009b39a"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#aed123a1f21f9a60d671966d6d009b39a">soap_clr_session_vars</a> (struct soap *soap, const char *domain, const char *path)</td></tr>
<tr class="memdesc:aed123a1f21f9a60d671966d6d009b39a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees all session vars in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path).  <a href="#aed123a1f21f9a60d671966d6d009b39a">More...</a><br /></td></tr>
<tr class="separator:aed123a1f21f9a60d671966d6d009b39a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a111decf2a202afda5381ada3d6904d06"><td class="memItemLeft" align="right" valign="top">SOAP_FMAC1 void SOAP_FMAC2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a111decf2a202afda5381ada3d6904d06">soap_clr_session_var</a> (struct soap *soap, const char *name, const char *domain, const char *path)</td></tr>
<tr class="memdesc:a111decf2a202afda5381ada3d6904d06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees session var with the given name in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path).  <a href="#a111decf2a202afda5381ada3d6904d06">More...</a><br /></td></tr>
<tr class="separator:a111decf2a202afda5381ada3d6904d06"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ab4cacc320c88e2c5ccdacd85f06ad98e"><td class="memItemLeft" align="right" valign="top">const char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ab4cacc320c88e2c5ccdacd85f06ad98e">sessions_id</a> [] = <a class="el" href="sessions_8h.html#a7646ccad5d55f18736f7df123cf23411">SESSIONS_ID</a></td></tr>
<tr class="separator:ab4cacc320c88e2c5ccdacd85f06ad98e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43d1b9d2d7f8ec98750b6fd2d978a630"><td class="memItemLeft" align="right" valign="top">static struct <a class="el" href="structsoap__session.html">soap_session</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a43d1b9d2d7f8ec98750b6fd2d978a630">soap_sessions</a> = NULL</td></tr>
<tr class="separator:a43d1b9d2d7f8ec98750b6fd2d978a630"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bcb2b1243de5feefd88372ca41d0cb5"><td class="memItemLeft" align="right" valign="top">static struct <a class="el" href="structsoap__session.html">soap_session</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a1bcb2b1243de5feefd88372ca41d0cb5">soap_sessions_tail</a> = NULL</td></tr>
<tr class="separator:a1bcb2b1243de5feefd88372ca41d0cb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14cc85c894edb525f4553f47a1060f92"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a14cc85c894edb525f4553f47a1060f92">num_sessions</a> = 0</td></tr>
<tr class="separator:a14cc85c894edb525f4553f47a1060f92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9ddb34cf48bc2bea7b8eede93bb2474"><td class="memItemLeft" align="right" valign="top">static time_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#ac9ddb34cf48bc2bea7b8eede93bb2474">last_purged_sessions</a></td></tr>
<tr class="separator:ac9ddb34cf48bc2bea7b8eede93bb2474"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a887d06d78eeffc2b7db2469fa1fea94f"><td class="memItemLeft" align="right" valign="top">static MUTEX_TYPE&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sessions_8c.html#a887d06d78eeffc2b7db2469fa1fea94f">sessions_lock</a> = MUTEX_INITIALIZER</td></tr>
<tr class="separator:a887d06d78eeffc2b7db2469fa1fea94f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a12965eefeba72c54882e27e4bcaf9345"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 sessions </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Plugin registry function, invoked by soap_register_plugin. </p>

</div>
</div>
<a class="anchor" id="ae5ea118213749cb0ce001879de12362d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void sessions_delete </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Deletes all sessions. Called when plugin is ended by first caller. </p>

</div>
</div>
<a class="anchor" id="a27b5742e46f66cc7fb68d4c7c74b26de"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int sessions_init </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Used by plugin registry function. </p>

</div>
</div>
<a class="anchor" id="a111decf2a202afda5381ada3d6904d06"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_clr_session_var </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees session var with the given name in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). </p>

</div>
</div>
<a class="anchor" id="aed123a1f21f9a60d671966d6d009b39a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_clr_session_vars </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees all session vars in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). </p>

</div>
</div>
<a class="anchor" id="ad73417b764dd9ebfcf0eba4c8dff48f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_end_session </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Also clears the cookie. </p>

</div>
</div>
<a class="anchor" id="a341353355afa9a8dfbfb3a348a928c8f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_end_sessions </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees all sessions in database. </p>

</div>
</div>
<a class="anchor" id="a086a1202b1aec2daa62f0e03dfc6d6ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_get_num_session_vars </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the number of sessions variables in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Returns -1 if the session does not exist. </p>

</div>
</div>
<a class="anchor" id="a522ae0821d5fe7c649592815e59f3c6a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_get_num_sessions </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the number of sessions in the database. </p>

</div>
</div>
<a class="anchor" id="aa0174ffa84386ab41f9e1d2ba8794d04"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a>* SOAP_FMAC2 soap_get_session </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finds the session identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path. Updates session's last_touched to now. Returns NULL if not found. </p>

</div>
</div>
<a class="anchor" id="aaf0feecf4196b36cb479faf3ec5ccf87"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 long SOAP_FMAC2 soap_get_session_cookie_maxage </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the cookie_maxage for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the cookie is a session cookie. 0 means a session was not found or is expired. </p>

</div>
</div>
<a class="anchor" id="ac6d91a83816d098d4811192616bad6f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 long SOAP_FMAC2 soap_get_session_max_inactive_secs </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the max_inactive_secs for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session will never expire. 0 means the session wasn't found or is expired. </p>

</div>
</div>
<a class="anchor" id="a0129b80db0867c481da326066479d0c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_get_session_rolling </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the <code>rolling</code> flag for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session was not found or is expired. </p>

</div>
</div>
<a class="anchor" id="a9ef5df49d2579505149b4f7ca5c388cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 const char* SOAP_FMAC2 soap_get_session_var </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns session_var value by name in the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). Returns NULL if not found. </p>

</div>
</div>
<a class="anchor" id="a539448f198293a94eae014318369036f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a>* SOAP_FMAC2 soap_get_sessions_head </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets soap_sessions (first node in sessions linked list). </p>

</div>
</div>
<a class="anchor" id="af89638dcb0fed58b795c3134f847d69d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_purge_sessions </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>when</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes all sessions that have been stale longer than their max_inactive_secs allows. -1 max_inactive_secs means the session will never expire. The when parameter is usually the current time, i.e. time(NULL) to purge sessions that expire after the when time. </p>
<p>This is called internally every time a session or a session_var is accessed, so it shouldn't ever be necessary to manually call this function.</p>
<p>Only will purge when the last time we purged was more than SESSION_PURGE_INTERVAL seconds ago (defined in <a class="el" href="sessions_8h.html">sessions.h</a>). SESSION_PURGE_INTERVAL == -1 means never purge. SESSION_PURGE_INTERVAL == 0 means always purge. </p>

</div>
</div>
<a class="anchor" id="ab109b671edecc2dd065b5416c2f3c45a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a>* SOAP_FMAC2 soap_regenerate_session_id </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The session ID for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path) will be set to a new random 128-bit ID. Also updates the cookie. Returns a pointer to the session. </p>

</div>
</div>
<a class="anchor" id="ada1884030904ff77824e3dbbcbec7a01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_session_cookie_create </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>maxage</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Intended for internal plugin use. Creates a cookie that will be sent to the client, named SESSION_COOKIE_NAME with the given value, domain, and path. </p>

</div>
</div>
<a class="anchor" id="a7bee91148cedca55855d7297690aafc8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 void SOAP_FMAC2 soap_session_cookie_delete </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Intended for internal plugin use. Creates a cookie that will be sent to the client, named SESSION_COOKIE_NAME with the given domain and path. The value will be empty and it will be set to expire when the client recieves it. This ensures the session ID is no longer in the client's cookie. </p>

</div>
</div>
<a class="anchor" id="aca8181bca0dfcca9f4a44058e1bda489"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a>* SOAP_FMAC2 soap_session_internal_find </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">time_t&#160;</td>
          <td class="paramname"><em>when</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Intended for internal plugin use. Find the current session with domain and path. Returns NULL if not found or if the session is expired (for normal use, set <code>when</code> to <code>time(NULL)</code>). Will also clear the cookie if the session is expired. </p>

</div>
</div>
<a class="anchor" id="a7455f112585da290cf814b7b002496a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_set_session_cookie_maxage </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>maxage</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the cookie_maxage for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the cookie will be a session cookie. If successful, returns SOAP_OK, or SOAP_ERR otherwise. </p>

</div>
</div>
<a class="anchor" id="aaa12654f17fa42f4cdd93a3a11aec435"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_set_session_max_inactive_secs </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the max_inactive_secs for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). -1 means the session will never expire. If successful, returns SOAP_OK, or SOAP_ERR otherwise. </p>

</div>
</div>
<a class="anchor" id="ab4bfe8aeec045e9f31bd860fa4627ef8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 int SOAP_FMAC2 soap_set_session_rolling </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rolling</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the <code>rolling</code> flag for the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). If successful, returns SOAP_OK, or SOAP_ERR otherwise. </p>

</div>
</div>
<a class="anchor" id="a60cae529297cd676f6781328c0f39cd5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session__var.html">soap_session_var</a>* SOAP_FMAC2 soap_set_session_var </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add new session_var with the given name and value to the current session (identified by the cookie with name SESSION_COOKIE_NAME and the given domain and path). If the name is already used, the value is re-written. If successful, returns pointer to a session_var node in the session's linked list, or NULL otherwise. </p>

</div>
</div>
<a class="anchor" id="a61db3eb7e302105558a0871e120fa108"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SOAP_FMAC1 struct <a class="el" href="structsoap__session.html">soap_session</a>* SOAP_FMAC2 soap_start_session </td>
          <td>(</td>
          <td class="paramtype">struct soap *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>domain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new session with a random 128-bit ID. A cookie will be created with name SESSION_COOKIE_NAME and the given domain and path. If there already exists a session ID cookie, the only action will be updating the session's last_touched to now. Returns a pointer to the session. </p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ac9ddb34cf48bc2bea7b8eede93bb2474"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">time_t last_purged_sessions</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Time that we last purged expired sessions </p>

</div>
</div>
<a class="anchor" id="a14cc85c894edb525f4553f47a1060f92"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int num_sessions = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Number of sessions in database </p>

</div>
</div>
<a class="anchor" id="ab4cacc320c88e2c5ccdacd85f06ad98e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char sessions_id[] = <a class="el" href="sessions_8h.html#a7646ccad5d55f18736f7df123cf23411">SESSIONS_ID</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>plugin identification for plugin registry </p>

</div>
</div>
<a class="anchor" id="a887d06d78eeffc2b7db2469fa1fea94f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">MUTEX_TYPE sessions_lock = MUTEX_INITIALIZER</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Session database lock </p>

</div>
</div>
<a class="anchor" id="a43d1b9d2d7f8ec98750b6fd2d978a630"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structsoap__session.html">soap_session</a>* soap_sessions = NULL</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Head node of session database (linked list) </p>

</div>
</div>
<a class="anchor" id="a1bcb2b1243de5feefd88372ca41d0cb5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structsoap__session.html">soap_session</a>* soap_sessions_tail = NULL</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Tail node of session database </p>

</div>
</div>
</div><!-- contents -->
<hr class="footer">
<address class="footer">
Copyright (C) 2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Wed Aug 17 2016 10:37:47 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.10</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
